package day5;

import java.util.Scanner;


//统计回文 的个数
public class oj1 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str1 = scan.nextLine();
        String str2 = scan.nextLine();
        int len = str1.length();
        int count = 0;
        for(int i = 0; i <= len; i++) {
            StringBuffer str = new StringBuffer(str1);
            str.insert(i,str2);
            StringBuffer str4 = new StringBuffer(str);
            StringBuffer str5 = str4.reverse();
            //StringBuffer中没有equals方法，所以我们要转为string
            if(str.toString().equals(str5.toString())) {
                count++;
            }

        }
        System.out.println(count);

    }
}
